package com.kingsoft.miot.bridge.service.impl.manager;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kingsoft.miot.bridge.dao.manager.ActionGroupRecordDao;
import com.kingsoft.miot.bridge.exception.CommonException;
import com.kingsoft.miot.bridge.pojo.manager.ActionGroupRecord;
import com.kingsoft.miot.bridge.service.manager.ActionGroupRecordService;

/**
 *
 * 权限角色记录服务
 * 
 * @author HUJIANQING
 *
 */
@Service
public class ActionGroupRecordServiceImpl implements ActionGroupRecordService {

	@Autowired
	private ActionGroupRecordDao actionGroupRecordDao;

	/**
	 * 通过角色id获取相关的权限信息 列表
	 */
	@Override
	public List<ActionGroupRecord> getByGroupId(int group_info_id) {
		try {
			return actionGroupRecordDao.getByGroupId(group_info_id);
		} catch (Exception e) {
			throw new CommonException(e);
		}
	}

	/**
	 * 通过group code 获取相关的信息代码
	 */
	@Override
	public List<ActionGroupRecord> getByGroupCode(String group_info_code) {
		try {
			return actionGroupRecordDao.getByGroupCode(group_info_code);
		} catch (Exception e) {
			throw new CommonException(e);
		}
	}

}
